<template>
	<view class="container">
		<view class="footer">
			<view class="middle">
				<view @click="toTiaoz(item)" class="" v-for="(item,index) in list" :key="index">
					<image :src="item.icon" class="picture" mode=""></image>
					<view class="title">
						{{item.name}}
					</view>
				</view>
			</view>
			<view class="bottom">
				<image @click="toBack" src="../../static/throughTrain/gb.png" mode=""></image>
			</view>
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[
				// 	{
				// 	id:1,
				// 	icon:this.$mAssetsPath.yjwt,
				// 	name:"一键委托",
				// 	url:this.$mRoutesConfig.login
				// },
				{
					id:2,
					icon:this.$mAssetsPath.jrhb,
					name:"加入伙伴",
					url:this.$mRoutesConfig.joinPartner
				},{
					id:3,
					icon:this.$mAssetsPath.xmdj,
					name:"项目登记",
					url:this.$mRoutesConfig.projectRegistration
				}],	
			}
		},
		methods: {
			async toTiaoz(item){
				// debugger;
					if(item.id == 3){
						let result = await this.$apis.checkIsJoin();
						if (result.data.result) {
							if (result.data.statusTitle == '审核通过') {
								this.$mRouter.push({
									route: item.url
								});
							} else {
								uni.showToast({
									title: "您的加入伙伴正在申请审核中！",
									icon: 'none'
								});
								return;
							}
						} else {
							uni.showToast({
								title: "请先申请加入伙伴！",
								icon: 'none'
							});
							return;
						}
					}else if(item.id == 1){
						this.$refs.uToast.show({
							title: '正在开发，敬请期待',
							type: 'success',
						})
					}else{
						this.$mRouter.push({
							route: item.url
						});
						
					}
			},		
			toBack(){
				uni.switchTab({
				    url: '../tabBar/index'
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.footer {
		position: fixed;
		bottom:0;
		width:100%;	
		height:500rpx;
	}
	.middle{
		display: flex;
		flex-direction: row;
		justify-content:space-around;
		height: 130rpx;
		margin-bottom:200rpx;
	}
	.picture{
		width: 110rpx;
		height: 110rpx;
	}
	.title{
		font-size: 30rpx;
		font-family: Source Han Sans SC;
		font-weight: bold;
		color: #0E1E36;
	
	}
	.bottom{
		text-align: center;
		image{
			width: 50rpx;
			height: 50rpx;
		}
	}
</style>